package LeetCode.month01.day28;

public class No1016 {
    public static void main(String[] args) {
        System.out.println(queryString("110101011011000011011111000000", 15));//1010
    }
    public static boolean queryString(String s, int n) {
        for (int i = 1; i <= n; i++) {
            StringBuilder sb = new StringBuilder();
            int len = i;
            while(len>0){
                sb.append(len%2);
                len/=2;
            }
            String s1 = sb.reverse().toString();
            if(!s.contains(s1)) return false;
        }
        return true;
    }
}
